<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="./styles/general.css" rel="stylesheet" type="text/css" />
<link href="./styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../images/jquery.js"></script>
<style>
table tr td{ text-align:center;}
</style>

<title></title>
</head>
<script type="text/javascript">
	
	function delproduct(url)
	{   
		if(window.confirm('是否要删除本条产品信息，删除后无法恢复！'))
		{
			location.href=url;
		}
		else
		{
			return false;
		}
	}
	function addnewproduct(url)
	{
		location.href=url;
	}
	
	function verifyproduct(url)
	{
		if(window.confirm('点击确定通过产品审核，点击取消未通过审核！'))
		{
			url=url+"&verify=1";
			location.href=url;
		}
		else
		{
			url=url+"&verify=2";
			location.href=url;
		}
	}
</script>
<body>
<h1>
<span class="action-span">
<a href="./store.php?action=StoreList">分类列表</a>
</span>
<span class="action-span1">
<a href="i#">关联产品管理</a>
</span>
<span id="search_id" class="action-span1"> - 产品列表 </span>
<div style="clear:both"></div>
</h1>


<form method="POST" action="./store.php?action=ManageSearchProductList ">

    <img height="22" border="0" width="26" alt="SEARCH" src="../images/icon_search.gif">
    <!-- 推荐 -->
    <select name="store_product_is_recommend"><option value="0">全部</option><option value="1">推荐</option><option value="2"> 未推荐</option></select>
    <!-- 发布-->
    <select name="store_product_state"><option value="0">全部</option><option value="1">发布</option><option value="2">未发布</option></select>
    <!-- 审核-->
    <select name="store_product_verify"><option value="0">全部</option><option value="1">待审核</option><option value="2">通过审核</option><option value="3">未通过审核</option></select>
    
    <select name="search_type"><option value="0">产品编号</option><option value="1">产品名称</option></select>
        <!-- 关键字 -->
    关键字 <input type="text" size="25" name="search_key"><input type="submit" class="button"  name="search" value=" 搜索 ">
    <input type="hidden" value="<{$store_id}>" name="store_id">

</form>


<form style="margin-top:20px;">
  <{if count($productlist)<=0}>
  <h2 style="text-align:center;">没有数据</h2>
  <{else}>
  <table width="100%" cellspacing="1" cellpadding="2" id="list-table" class="list-div">
    <tr>
      <th width="4%">产品ID</th>
      <th width="5%">产品编号</th>
      <th width="26%">产品名称</th>
      <th width="5%">版本号</th>
      <th width="5%">产品价格</th>
      <th width="5%">发布状态</th>
      <th width="5%">推荐状态</th>
      <th width="7">审核状态</th>
      <th width="6%">添加人</th>
      <th width="6%">添加时间</th>
      <th width="26%">操作</th>
    </tr>
    <{foreach from=$productlist key=myID item=product}>
    <tr>
      <td width="4%"><{$product.product_id}></td>
      <td width="5%"><{$product.product_sn}></td>
      <td width="26%"><a href="./product_operation.php?action=index&type=update&product_id=<{$product.product_id}>"><{$product.product_name}></a></td>
      <td width="5%"><{$product.product_version}></td>
      <td width="5%"><{$product.product_price}></td>
      <td width="5%"><{$product.store_product_state}></td>
      <td width="5%"><{$product.store_product_is_recommend}></td>
      <td width="7%"><{$product.store_product_verify}></td>
      <td width="6%"><{$product.store_product_add_user}></td>
      <td width="6%"><{$product.store_product_add_time}></td>
      <td width="26%"><a onclick="delproduct('./store.php?action=DelProduct&product_id=<{$product.product_id}>&store_id=<{$product.store_cat_id}>')" href="">删除</a>
      <{if $product.store_product_state=='未发布'}>
      	&nbsp;&nbsp;<a href="./store.php?action=StateProduct&product_id=<{$product.product_id}>&state_value=1&store_id=<{$product.store_cat_id}>">发布</a>
      <{else}>
      	&nbsp;&nbsp;<a href="./store.php?action=StateProduct&product_id=<{$product.product_id}>&state_value=0&store_id=<{$product.store_cat_id}>">取消发布</a>
      <{/if}>
      <{if $product.store_product_is_recommend=='未推荐'}>
      	&nbsp;&nbsp;<a href="./store.php?action=RecommendProduct&product_id=<{$product.product_id}>&rec_value=1&store_id=<{$product.store_cat_id}>">推荐</a>
      <{else}>
      	&nbsp;&nbsp;<a href="./store.php?action=RecommendProduct&product_id=<{$product.product_id}>&rec_value=0&store_id=<{$product.store_cat_id}>">取消推荐</a>
      <{/if}>
      &nbsp;&nbsp;<a onclick="verifyproduct('./store.php?action=VerifyProduct&product_id=<{$product.product_id}>&store_id=<{$product.store_cat_id}>')" href="">审核操作</a>
      &nbsp;&nbsp;<a href="./product.php?action=ManagePrice&product_id=<{$product.product_id}>">价格管理</a></td>
    </tr>
    <{/foreach}>
    <tr>
    <td colspan="11"><{$page_url}> &nbsp;&nbsp;&nbsp; 共有 <span id="total"><{$total}> </span>条记录</td>
    </tr>
  </table>
  <{/if}>
</form>
</body>
</html>
